package com.study.hisapi.exception;

import lombok.Getter;
import org.springframework.http.HttpStatus;

/**
 * 方法未重写异常
 *
 * @author LiXiao
 * @date 2024/4/13
 */
@Getter
public class MethodNotOverriddenException extends RuntimeException {
    private final int errorCode;
    private final String errorMessage;

    public MethodNotOverriddenException(String errorMessage) {
        super(errorMessage);
        this.errorCode = 10001;
        this.errorMessage = errorMessage;
    }

    public MethodNotOverriddenException(int errorCode, String errorMessage) {
        super(errorMessage);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }


    public MethodNotOverriddenException(HttpStatus status, String errorMessage) {
        super(errorMessage);
        this.errorCode = status.value();
        this.errorMessage = errorMessage;
    }
}
